10th international ABINIT developer workshop
May 31 - June 4, 2021 - Smart Working, Lockdown@BE

Use the Space key to navigate through all slides.

NB: AbiPy can be interfaced with other packages (e.g ASE, phonopy) via converters.
Using conda and the conda forge channel (recommended):
conda install abipy --channel conda-forge
Since conda is not limited to python packages, one can install ABINIT in the same env with:
conda install abinit -c conda-forge
Using pip and python wheels:
pip install abipy --user
From the github repository:
git clone https://github.com/abinit/abipy.git
cd abipy
python setup.py install # or `develop` for development
For further info see http://abinit.github.io/abipy/installation.html
In addition to the standard workflows/tools for GS, DFPT, $GW$, IP optics, Bethe-Salpeter, we have:
New Flows and improved post-processing tools for:
Python converters: DDB $\;\rightleftarrows \;$ phonopy / tdep

NB: There's an ongoing effort to reimplement AbiFlows in terms of the atomate framework. In this talk, we will mainly discuss the new features available in abipy.flowtk.
For the formalism, see: XXX
scf_input = make_scf_input() # Build input for GS calculation
elast_work = flowtk.ElasticWork.from_scf_input(scf_input,
with_relaxed_ion=True,
with_piezo=True)

elastic_ddb = abilab.abiopen("elastic_DDB")
edata = elastic_ddb.anaget_elastic()
edata.get_elastic_properties_dataframe(properties_as_index=True)
| property | 0 | 1 | |
|---|---|---|---|
| 0 | trans_v | 3.194459e+03 | 3.838052e+03 |
| 1 | long_v | 5.796035e+03 | 6.295200e+03 |
| 2 | snyder_ac | 5.767044e+01 | 8.693459e+01 |
| 3 | snyder_opt | 3.158141e-01 | 3.621134e-01 |
| 4 | snyder_total | 5.798626e+01 | 8.729670e+01 |
| 5 | clarke_thermalcond | 7.734051e-01 | 9.006348e-01 |
| 6 | cahill_thermalcond | 8.539415e-01 | 9.791319e-01 |
| 7 | debye_temperature | 3.760623e+02 | 4.477874e+02 |
| 8 | k_voigt | 7.553865e+01 | 7.553930e+01 |
| 9 | k_reuss | 7.553074e+01 | 7.553579e+01 |
| 10 | k_vrh | 7.553469e+01 | 7.553754e+01 |
| 11 | g_voigt | 3.951341e+01 | 5.767416e+01 |
| 12 | g_reuss | 3.761300e+01 | 5.366047e+01 |
| 13 | g_vrh | 3.856321e+01 | 5.566731e+01 |
| 14 | universal_anisotropy | 2.527308e-01 | 3.740360e-01 |
| 15 | homogeneous_poisson | 2.818554e-01 | 2.041909e-01 |
| 16 | y_mod | 9.886491e+10 | 1.340681e+11 |
# Pandas DataFrame with relaxed-atoms elastic tensor.
edata.elastic_relaxed
| xx | yy | zz | yz | xz | xy | |
|---|---|---|---|---|---|---|
| Voigt index | ||||||
| xx | 135.262182 | 54.450376 | 38.052927 | 0.00000 | 0.000000 | 0.000000 |
| yy | 54.450376 | 135.262181 | 38.052927 | 0.00000 | 0.000000 | 0.000000 |
| zz | 38.052927 | 38.052926 | 148.211029 | 0.00000 | 0.000000 | 0.000000 |
| yz | 0.000000 | 0.000000 | 0.000000 | 30.55071 | 0.000000 | 0.000000 |
| xz | 0.000000 | 0.000000 | 0.000000 | 0.00000 | 30.550709 | 0.000000 |
| xy | 0.000000 | 0.000000 | 0.000000 | 0.00000 | 0.000000 | 40.405903 |
from abipy.abio.factories import gs_input
gs_input(structure="si.cif", pseudos="14si.pspnc", ecut=8)
multi = abilab.ebands_input(structure="si.cif",
pseudos="14si.pspnc",
ecut=8,
spin_mode="unpolarized",
smearing=None,
dos_kppa=5000)
multi.get_vars_dataframe("kptopt", "iscf", "ngkpt")
| kptopt | iscf | ngkpt | |
|---|---|---|---|
| dataset 0 | 1 | None | [8, 8, 8] |
| dataset 1 | -11 | -2 | None |
| dataset 2 | 1 | -2 | [14, 14, 14] |
This flow computes:
\begin{equation*} \newcommand{\PDER}[2]{\dfrac{\partial #1}{\partial #2}} \gamma_{\mathbf{q}\nu} = -\PDER{\ln \wqnu}{\ln V} = -\dfrac{V}{\wqnu}\,\PDER{\wqnu}{V} \end{equation*}where $D(\mathbf{q})\,{\epsilon_{\mathbf{q}\nu}} = \omega^2_s(\mathbf{q})\,\epsilon_{\mathbf{q}\nu}$ with $D$ the dynamical matrix.
The derivative wrt $V$ can be rewritten as:
\begin{equation*} \PDER{\omega^2(\mathbf{q}\nu)}{V} = 2\wqnu\,\PDER{\wqnu}{V} \langle \eqnu | \PDER{D(\qq)}{V} | \eqnu \rangle \end{equation*}where the r.h.s is computed by anaddb using finite differences of DFPT results.
scf_input = make_scf_input() # Build input for GS calculation
from abipy.flowtk.gruneisen import GruneisenWork
voldelta = gs_inp.structure.volume * 0.02
work = GruneisenWork.from_gs_input(gs_inp, voldelta, ngqpt=[2, 2, 2],
with_becs=False)

gruns = abiopen("out_GRUNS.nc")
gruns.plot_gruns_scatter();
For the formalism see J. Laflamme Janssen, et. al. Phys. Rev. B 93, 205147
scf_input = make_scf_input() # Get the SCF input (without SOC)
from abipy.flowtk.effmass_works import EffMassAutoDFPTWork
flow = flowtk.Flow("effmass_flow")
work = EffMassAutoDFPTWork.from_scf_input(scf_input)
flow.register_work(work)

This flow computes the e-ph matrix elements in AlAs along a q-path
The final results are stored in the GKQ.nc file (one file per q-point) in the outdata of each task.
# Build input for GS calculation on a 2x2x2 k-mesh
scf_input = make_scf_input(ngkpt=(2, 2, 2))
# q-mesh for phonons
ngqpt = (2, 2, 2)
# Create flow to compute all the independent atomic perturbations
# Use ndivsm = 0 to pass an explicit list of q-points.
# If ndivsm > 0, qpath_list is interpreted as a list of boundaries for the q-path
qpath_list = [[0.0, 0.0, 0.0], [0.01, 0, 0], [0.1, 0, 0],
[0.24, 0, 0], [0.3, 0, 0], [0.45, 0, 0], [0.5, 0.0, 0.0]]
from abipy.flowtk.eph_flows import GkqPathFlow
flow = GkqPathFlow.from_scf_input("flow_dir", scf_input,
ngqpt, qpath_list, ndivsm=0, with_becs=True,
ddk_tolerance={"tolwfr": 1e-8})
Formalism:
https://abinit.github.io/abipy/flow_gallery/run_gkq.html#sphx-glr-flow-gallery-run-gkq-py
(contributed by G. Petretto)
Can be used to:
Algorithm:
output_dir_path.In python, everything boils down to:
ddb = abilab.abiopen("mp-149_DDB")
phonopy_obj = ddb.anaget_phonopy_ifc(output_dir_path="output_dir")


gsr = abiopen("si_nscf_GSR.nc")
gsr.ebands.plot(with_gaps=True);
(contributed by Y. He)
gsr.ebands.plotly(with_gaps=True); # object.plot becomes object.plotly
gsr.ebands.plotly(with_gaps=True, chart_studio=True);

gsr.ebands.kpoints.plotly(title="k-path in 3d with plotly");
gsr.ebands.kpoints.plot(title="Static matplotlib figure");


ddb = abilab.abiopen("ZnSe_hex_qpt_DDB")
abilab.abipanel(); # Important
ddb.get_panel()
ddb.structure.get_panel()

--panel option:¶abiopen.py out_DDB --panel # or -pn if you prefer the short option.

abiopen.py mgb2_kpath_FATBANDS.nc --expose --seaborn
abiopen.py mgb2_kpath_FATBANDS.nc --expose-web # -ewb
abiopen.py mgb2_kpath_FATBANDS.nc --plotly # -ply

abiopen.py out_GRUNS.nc --expose-web # -ew for the short version

abiview.py ddb ZnSe_hex_qpt_DDB --plotly # -ply

%embed https://abinit.github.io/abipy/graphical_interface.html


scheduler.yml providing:
manager.yml providing:
See this page for examples or use the abidoc.py script and the syntax:
run_elastic.py --scheduler # -s for the short option
nohup
so that we can disconnect from the shell session without killing the scheduler.nohup run_elastic.py --s > log 2> err &